programming4us
           
 
 
Windows

Windows 7 : Working at the Command Line (part 2)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/5/2010 11:46:32 AM

Taking Advantage of DOSKEY

Windows 7 loads the DOSKEY utility by default when you start any command-line session. This useful little program brings a number of advantages to your command-line work:

  • You can recall previously entered commands with just a keystroke or two.

  • You can enter multiple commands on a single line.

  • You can edit commands instead of retyping them.

The next few sections take you through the specifics.

Recalling Command Lines

The simplest DOSKEY feature is command recall. DOSKEY maintains a command history buffer that keeps a list of the commands you enter. To scroll through your previously entered commands in reverse order, press the up-arrow key; when you’ve done that at least once, you can change direction and run through the commands in the order you entered them by pressing the down-arrow key. To rerun a command, use the arrow keys to find it and then press Enter.

Tip

If you don’t want to enter commands from the history buffer, press Esc to get a clean command line.


Table 2 lists all the command-recall keys you can use.

Table 2. DOSKEY Command-Recall Keys
PressTo
Up arrowRecall the previous command in the buffer.
Down arrowRecall the newest command in the buffer.
Page UpRecall the oldest command in the buffer.
Page DownRecall the newest command in the buffer.
F7Display the entire command buffer.
Alt+F7Delete all commands from the buffer.
F8Have DOSKEY recall a command that begins with the letter or letters you’ve typed on the command line.
F9Have DOSKEY prompt you for a command list number. (You can see the numbers with the F7 key.) Type the number and press Enter to recall the command.

Tip

The command history buffer holds 50 commands by default. If you need a larger buffer, run DOSKEY with the /LISTSIZE=buffers switch, where buffers is the number of commands you want to store. You also need to include the /REINSTALL switch to install a new copy of DOSKEY, which puts the new history buffer setting into effect. For example, to change the buffer size to 100, enter the following command:

doskey /listize=100 /reinstall


Entering Multiple Commands on a Single Line

DOSKEY enables you to run multiple commands on a single line. To do this, insert the characters && between commands. For example, a common task is to change to a different drive and then run a directory listing. Normally, you’d do this with two separate commands:

e:
dir

With DOSKEY, however, you can do it on one line, like so:

e:&&dir

Tip

You can enter as many commands as you like on a single line, but just remember that the total length of the line can’t be more than 8,191 characters (which should be plenty!).


Editing Command Lines

Instead of simply rerunning a previously typed command, you might need to run the command again with slightly different switches or parameters. Rather than retyping the whole thing, DOSKEY enables you to edit any recalled command line. You use various keys to move the cursor to the offending letters and replace them. Table 3 summarizes DOSKEY’s command-line editing keys.

Table 3. DOSKEY Command-Line Editing Keys
PressTo
Left arrowMove the cursor one character to the left.
Right arrowMove the cursor one character to the right.
Ctrl+left arrowMove the cursor one word to the left.
Ctrl+right arrowMove the cursor one word to the right.
HomeMove the cursor to the beginning of the line.
EndMove the cursor to the end of the line.
DeleteDelete the character over the cursor.
BackspaceDelete the character to the left of the cursor.
Ctrl+HomeDelete from the cursor to the beginning of the line.
Ctrl+EndDelete from the cursor to the end of the line.
InsertToggle DOSKEY between Insert mode (your typing is inserted between existing letters on the command line) and Overstrike mode (your typing replaces existing letters on the command line).

Other -----------------
- Windows 7 : Getting to the Command Line (part 2) - Running CMD
- Windows 7 : Getting to the Command Line (part 1)
- Windows Azure : Programming Access Control Service (part 10) - Deploying the Web Service in Windows Azure
- Windows Azure : Programming Access Control Service (part 9) - Configuring a Web Service Client to Acquire and Send SAML Tokens
- Windows Azure : Programming Access Control Service (part 8)
- Windows Azure : Programming Access Control Service (part 7) - Integrating ACS with a SAML Token Provider
- Windows Azure : Programming Access Control Service (part 6)
- Windows Azure : Programming Access Control Service (part 5)
- Windows Azure : Programming Access Control Service (part 4)
- Windows Azure : Programming Access Control Service (part 3)
- Windows Azure : Programming Access Control Service (part 2)
- Windows Azure : Programming Access Control Service (part 1)
- Windows 7 : Working with Registry Entries (part 3)
- Windows 7 : Working with Registry Entries (part 2)
- Windows 7 : Working with Registry Entries (part 1) - Changing the Value of a Registry Entry
- Windows 7 : Keeping the Registry Safe
- Windows 7 : Getting to Know the Registry (part 2)
- Windows 7 : Getting to Know the Registry (part 1) - Understanding Registry Settings
- Windows 7 : Firing Up the Registry Editor
- Windows Azure : Managing Access Control Service Resources (part 2)
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us